<template>
	<view class="box-color box-padding u-flex" hover-stay-time="150" hover-class="u-cell-hover" style="position: relative;">
		<view>
			<image :src="isProfessional ? '/static/common/zhuanpiao.png':'/static/common/pupiao.png'" style="width: 75rpx;height: 75rpx;vertical-align: middle;" mode=""></image>
		</view>
		<view class="u-flex-col u-m-l-30">
			<view class="u-font-32 u-m-b-16">
				{{ invoice.name }}
			</view>
			<view class="u-font-24 grey-color">
				税号 {{ invoice.identityNo }}
			</view>
		</view>
		<view v-if="isChange" class="u-flex-1 u-flex u-row-right">
			<ak-switch :switchList="['专', '普']" :borderRadius="5" :activeProportion="50" bg_color="#EEEEEE" :checked_bg_color="themeColor" :defaultSwitch="isProfessional" @change="changeSwitch"></ak-switch>
		</view>
		<view v-if="isElectronic" style="position: absolute;top:0;right: 35rpx;">
			<image src="/static/common/dian.png" style="width: 37rpx;height: 50rpx;" mode=""></image>
		</view>
	</view>
</template>

<script>
	import AkSwitch from '@/components/ak-switch/index.vue'
	export default {
		components: { AkSwitch },
		props: {
			invoice: {
				type: Object,
				default: () => {}
			},
			isElectronic: {
				type: Boolean,
				default: false
			},
			isChange: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				isProfessional: this.invoice.isProfessional ? this.invoice.isProfessional : false
			}
		},
		methods: {
			changeSwitch(v) {
				this.isProfessional = v
				this.$emit('changeInvoice', v)
			}
		}
	}
</script>

<style>
</style>
